<?php


namespace app\mini\controller\v1\shop;

use app\common\library\MemberVo;
use app\common\logic\RechargeLogic;
use app\common\logic\ShopMemberLogic;
use app\mini\controller\Common;
use think\Request;
use think\response\Json;

class Role extends Common
{
    public $ShopMemberLogic;

    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $this->ShopMemberLogic = new ShopMemberLogic();
    }

    /**
     * 角色列表
     * @return Json
     */
    public function index(): Json
    {
        $res = $this->exception(function () {
            return $this->ShopMemberLogic->role_index();
        });
        return $this->response($res);
    }


    /**
     * 角色切换
     * @return Json
     */
    public function exchange(): Json
    {
        $res = $this->exception(function () {
            return $this->ShopMemberLogic->exchange(request()->param());
        });
        return $this->response($res);
    }
}